//
//  LocalMusicController.m
//  Kugou-OC
//
//  Created by BH on 16/5/25.
//  Copyright © 2016年 Sunny. All rights reserved.
//

#import "LocalMusicController.h"
#import "BottomPlayView.h"
#import "SingleController.h"
#import "SingerController.h"
#import "AlbumController.h"
#import "IPodController.h"
#import "GlobalDefine.h"
#import <SDAutoLayout/UIView+SDAutoLayout.h>
#import <NinaPagerView/NinaPagerView.h>

@interface LocalMusicController ()

@end

@implementation LocalMusicController
//隐藏bottomview
//-(void)viewWillAppear:(BOOL)animated{
//    [super viewWillAppear:animated];
//    
//    for (UIView *subview in [UIApplication sharedApplication].keyWindow.subviews) {
//        if ([subview isKindOfClass:[BottomPlayView class]]) {
//            
//            [UIView animateWithDuration:0.3 animations:^{
//                subview.alpha = 0;
//            } completion:^(BOOL finished) {
//                subview.hidden = YES;
//            }];
//        }
//    }
//}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"本地音乐";
    self.rightItems = @{@"img1":@"top_more",@"img2":@"top_list"};
    self.navigationController.navigationBar.translucent = NO;
    //初始化menu
    NSArray *titleArr = @[@"单曲",@"歌手",@"专辑",@"iPod"];
    
    //初始化子控制器
    SingleController *single = ALLOC(SingleController);
    single.singleList = self.localList;
    single.playIndex = self.playIndex;
    SingerController *singer = ALLOC(SingerController);
    AlbumController *album = ALLOC(AlbumController);
    IPodController *iPod = ALLOC(IPodController);
    NSArray *vcArr = @[single,singer,album,iPod];
    
    //设置菜单栏颜色
    NSArray *colorArr = @[BG_COLOR,[UIColor blackColor],BG_COLOR,[UIColor whiteColor]];
    
    //添加
    NinaPagerView *ninaPagerView = [[NinaPagerView alloc] initWithNinaPagerStyle:NinaPagerStyleBottomLine WithTitles:titleArr WithVCs:vcArr WithColorArrays:colorArr];
    [self.view addSubview:ninaPagerView];
}

@end
